package com.zwf.mapper;

import com.zwf.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author zwf
 * @date 2024/2/2 17:33
 */

@Mapper
public interface DishFlavorMapper {

    /**
     * 新增菜品口味
     * @param list
     */
    void add(List<DishFlavor> list);

    /**
     * 根据菜品id查询关联的口味值
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> queryByDishId(Long id);

    /**
     * 根据菜品id删除口味
     * @param id
     */
    @Delete("delete from dish_flavor where dish_id=#{id}")
    void delete(Long id);
}
